package src.Note.Note6;

/**
 * @Author： 20192315裴湘瑞
 * @Date: 2020/10/29 14:31
 * @Version: 1.0
 * @Target：比较两个数据是否相等
 * @Requirement：参数类型分别为两个(byte/short/int/long)类型
 */
public class Note6 {
    public static void main(String[] args) {
        byte a = 10;
        byte b = 20;
        System.out.println(isSame(a,b));
        System.out.println("===================");
        System.out.println(isSame((short)a,(short)b));
        System.out.println("===================");
        System.out.println(isSame((int)a,(int)b));
        System.out.println("===================");
        System.out.println(isSame((long)a,(long)b));
        System.out.println("===================");
    }
    public static boolean isSame(byte a, byte b) {
        System.out.println("两个byte参数比较");
        return a==b;
    }
    public static boolean isSame(short a, short b) {
        System.out.println("两个short参数比较");
        return a==b;
    }
    public static boolean isSame(int a, int b) {
        System.out.println("两个int参数比较");
        return a==b;
    }
    public static boolean isSame(long a, long b) {
        System.out.println("两个long参数比较");
        return a==b;
    }
}
